home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / docs / lwml9502.lha / Lightwave-Feb95 / 000352_owner-lightwave-l _Fri Feb 17 21:02:48 1995.msg < prev    next >
Internet Message Format  |  1995-03-19  |  9KB

  1. Return-Path: <owner-lightwave-l>
  2. Received: by netcom2.netcom.com (8.6.9/Netcom)
  3.     id SAA07315; Fri, 17 Feb 1995 18:50:01 -0800
  4. Received: from bos1b.delphi.com by netcom2.netcom.com (8.6.9/Netcom)
  5.     id SAA07293; Fri, 17 Feb 1995 18:49:52 -0800
  6. From: dnakakihara@BIX.com
  7. Received: from bix.com by delphi.com (PMDF V4.3-9 #7804)
  8.  id <01HN667L1BC09GVSDW@delphi.com>; Fri, 17 Feb 1995 21:49:50 -0500 (EST)
  9. Received: by bix.com (CoSy3.31.1.50) id <9502172148.memo.52080@BIX.com>; Fri,
  10.  17 Feb 1995 21:48:46 -0500 (EST)
  11. Date: Fri, 17 Feb 1995 21:48:46 -0500 (EST)
  12. Subject: LW to VLab Motion ARexx script
  13. To: lightwave-l@netcom.com
  14. Message-id: <9502172148.memo.52080@BIX.com>
  15. MIME-version: 1.0
  16. Content-type: TEXT/PLAIN
  17. Content-transfer-encoding: QUOTED-PRINTABLE
  18. X-CoSy-To: lightwave-l@netcom.com
  19. Sender: owner-lightwave-l@netcom.com
  20. Precedence: bulk
  21.  
  22. OK, by popular demand, here is my ARexx script that will automaticall=
  23. y
  24. import LW frames into VLab Motion and then delete them. 'Course you c=
  25. ould
  26. adapt it to other uses. In fact, I adapted it from another one I wrot=
  27. e
  28. that moved files over AmigaLink (floppy port) network--much faster
  29. than having LW write the files to the network.
  30.  
  31. Hope someone finds this useful.  As noted in the script header, it
  32. is very important to increase the task priority for VLab Motion.
  33.  
  34. --Doug
  35.  
  36. /*
  37. ** LW2VLM.rexx
  38. **
  39. ** $VER: LW2VLM.rexx 1.0.0 (02.13.95)
  40. **
  41. **
  42. ** Waits for LightWave 3D frames to be rendered and then imports them
  43. ** to a user-defined VLab-Motion MovieShop scene.
  44. **
  45. ** !!!YOU MUST HAVE A PROJECT OPEN!!!
  46. **
  47. ** Very rough but useful information about frame rendering time will
  48. ** be displayed.
  49. **
  50. ** If importing a file fails, the script will sense this and retry an
  51. ** unlimited amount of times, so don't worry.  This is indicated by
  52. ** the Import 'Attempt' information.
  53. **
  54. ** See bottom of this script for syntax.  Running script with no
  55. ** additional information will show syntax.  (e.g., RX LW2VLM)
  56. **
  57. ** Creates small log file in RAM: called LW2VLM.log
  58. **
  59. ** To get this to work properly, you must run MovieShop at a higher
  60. ** task priority than LightWave. The easiest way is to run MovieShop
  61. ** from the CLI using the following steps:
  62. **
  63. **    1) Open a CLI window.
  64. **    2) Type: "ChangeTaskPri 5" and press Return. (Don't enter=20
  65. **       quotes.)
  66. **    3) CD to your MovieShop directory.
  67. **    4) Type: "Run MovieShop" and press Return. (no quotes)
  68. **    5) Open an existing or start a new MovieShop project.
  69. **    6) Now run this script will the appropriate arguments.
  70. **
  71. ** There are also utilities available that allow you to change a task
  72. ** priority while things are running. If you don't adjust the MovieSh=
  73. op
  74. ** task priority higher than LightWave, the LightWave rendering proce=
  75. ss
  76. ** will hog the CPU and the files will not be imported on a timely
  77. ** basis.
  78. **
  79. ** Copyright =A9 1995 Douglas J. Nakakihara
  80. ** All rights reserved
  81. **
  82. ** Contact author at dnakakihara@bix.com
  83. **
  84. ** This script is freely distributable.
  85. */
  86.  
  87. Parse arg Basename Scenename Total First Increment
  88. options failat 21
  89. options results
  90. signal on Break_C
  91.  
  92. /*
  93. ** Log filename
  94. */
  95.  
  96. LogFN =3D 'ram:LW2VLM.log'
  97.  
  98. /*
  99. ** LightWave numeric extension length. If the extension length is
  100. ** ever changed, you only need to change this variable. NOTE: if
  101. ** frame numbering exceeds 999 or 9999, script will automatically
  102. ** increment this to 4 and 5, respectively.
  103. */
  104.  
  105. Extension =3D 3
  106.  
  107. /*
  108. ** Checks for essential arguments
  109. */
  110. =20
  111. If Basename =3D '' then do
  112.   Call Syntax
  113.   Exit
  114. End
  115.  
  116. If Scenename =3D '' then do
  117.   Call Syntax
  118.   Exit
  119. End
  120.  
  121. If Total =3D '' then do
  122.   Call Syntax
  123.   Exit
  124. End
  125. Total =3D strip(Total)
  126.  
  127.  
  128. /*
  129. ** Sets import parameters. Note if you will be importing fields,
  130. ** you will have to change the ImportPicType to 'Field' from=20
  131. ** 'Frame'. Also, the size correction has been set to scale. For
  132. ** best results, render to the exact size used for your project
  133. ** using LightWave's custom size feature.
  134. */
  135.  
  136. Address MOVIESHOP
  137.  
  138. ImportMethod Multipic
  139. ImportPicType Frames
  140. CorrectImportHeight Scale
  141. CorrectImportWidth Scale
  142.  
  143. /*
  144. ** If Scenename already exists, it is made the current scene and
  145. ** the dummy frame is made the current frame.
  146. */
  147.  
  148. NewScene Scenename
  149. If rc ~=3D 0 then do
  150.   Say 'Scenename already exists. Appending to it.'
  151.   GoToScene Scenename
  152. End
  153.  
  154. Address ()
  155.  
  156. /*
  157. ** library necessary for Delay command
  158. */
  159.  
  160. Lib=3D'rexxsupport.library'
  161. if ~show('L',Lib) then call addlib(Lib,0,-30,0)
  162.  
  163. /*
  164. ** Extract basename without path
  165. */
  166.  
  167. Basename2 =3D Basename
  168. A =3D lastpos("\", Basename2)
  169. If A > 0 then do
  170.   Basename2 =3D substr(Basename2, A + 1)
  171. End
  172. A =3D lastpos(":", Basename2)
  173. If A > 0 then do
  174.   Basename2 =3D substr(Basename2, A + 1)
  175. End
  176.  
  177. /*
  178. ** Set Increment to 1 if not given
  179. */
  180.  
  181. If Increment =3D '' then do
  182.   Increment =3D 1
  183. End
  184. Increment =3D strip(Increment)
  185.  
  186. /*
  187. ** Set First to 1 if not given
  188. */
  189.  
  190. If First =3D '' then do
  191.   First =3D 1
  192. End
  193. First =3D strip(First)
  194.  
  195. /*
  196. ** Write header to log file. Append if file exists
  197. */
  198.  
  199. Call OpenLog
  200. Writeln('logfile', '>>>> LW2VLM '||Basename||' '||Scenename,
  201.        ||' '||Total||' '||First||' '||Increment||' <<<<')
  202. Close('logfile')
  203.  
  204. /*
  205. ** Initialize counter=20
  206. */
  207.  
  208. Counter =3D First
  209. Do while Counter <=3D Total
  210.  
  211.   /*
  212.   ** Initialize various things
  213.   */
  214.  =20
  215.   Call time('R')
  216.   Counter =3D strip(Counter)
  217.   If Counter > 999 then Extension =3D 4
  218.   If Counter > 9999 then Extension =3D 5
  219.   Filename =3D Basename || right(Counter,Extension,'0')
  220.   Filename2 =3D Basename2 || right(Counter,Extension,'0')
  221.   RC=3D99
  222.   Imports =3D 0
  223.  
  224.   Say 'Waiting for ' || Filename || '... (Ctrl-C to abort)'
  225.  =20
  226.   Do while (RC ~=3D 0)
  227.  
  228.     /*
  229.     ** Wait for file
  230.     */
  231.    =20
  232.     Do while ~open('Testing', Filename, 'R')
  233.       Call delay(230)
  234.     End
  235.     Call delay(45)
  236.     Close('Testing')
  237.     Call delay(200)
  238.  
  239.     /*
  240.     ** Copy to VLM partition
  241.     */
  242.    =20
  243.     Imports =3D Imports + 1
  244.     Say ' -Importing (Attempt: ' || Imports || ') to ' || Scenename
  245.    =20
  246.     /*
  247.     ** Before importing, the script goes to the last frame in the
  248.     ** scene and then one more over to the dummy frame. This makes
  249.     ** it so the image is always added to the end of the scene.
  250.     */
  251.  
  252.     Address MOVIESHOP
  253.     GoToFrame Last
  254. =09GoToFrame Next
  255.     Importframe Filename
  256.     Address ()
  257.  
  258.  
  259.   End
  260.  
  261.   Say ' -Deleting source file'
  262.   Address command 'delete >nil: ' || Filename
  263.  
  264.   /*
  265.   ** Calculate timing information
  266.   */
  267.  =20
  268.   TESec =3D trunc(time('E')) /* Total Elapsed Seconds */
  269.   FPH =3D trunc(3600/TESec, 2) /* Frames Per Hour */
  270.   EMin =3D trunc(TESec/60)
  271.   ESec =3D trunc(TESec - (EMin * 60))
  272.   RendTime =3D EMin||'m ' || ESec || 's'
  273.   Say ' -Frame render time: ' || RendTime || ' (Frames/hour: '||FPH||=
  274. ')'
  275.  
  276.   FRemain =3D trunc((Total - Counter) / Increment)
  277.   Say ' -Frames remaining: ' || FRemain
  278.  
  279.   ERS =3D trunc(FRemain * TESec) /* Est. Remaining Seconds */
  280.   ERHrs =3D trunc(ERS/3600)
  281.   ERMin =3D trunc((ERS/60) - (ERHrs * 60))
  282.   ERSec =3D ERS - (trunc(ERS/60) * 60)
  283.   Say ' -Estimated remaining time: '||ERHrs||'h '||ERMin||'m '||ERSec=
  284. ||'s'
  285.  
  286.   /*
  287.   ** Update log file=20
  288.   */
  289.  =20
  290.   Call OpenLog
  291.   Message =3D Filename2||': Import attempts: '||Imports||' Render tim=
  292. e: ',
  293.             ||RendTime
  294.   Writeln('logfile', Message)
  295.   Close('logfile')
  296.  
  297.   /*
  298.   ** Increment frame counter
  299.   */
  300.  =20
  301.   Counter =3D Counter + Increment
  302.  
  303. End
  304.  
  305. Say 'All done!'
  306.  
  307. Call OpenLog
  308. Writeln('logfile', 'All done!')
  309. Close('logfile')
  310. Exit
  311.  
  312. Syntax:
  313.  
  314.   Say 'Syntax : LW2VLM <Basename> <Scenename> <Last> <First> <Incr>'
  315.   Say ''
  316.   Say 'Purpose: Imports rendered files to Scenename as they are rende=
  317. red.'
  318.   Say ''
  319.   Say '  Basename  =3D Filename to look for, excluding numeric'
  320.   Say '              extension. Include period, if used (e.g., PIC.)'
  321.   Say '              Basename can include path, like RAM:PIC.'
  322.   Say '  Scenename =3D MovieShop scene name. Appends if it already ex=
  323. ists.'
  324.   Say '  Last      =3D Last frame being rendered'
  325.   Say '  First     =3D Actual number of first frame'
  326.   Say '  Incr      =3D Frame number increment'
  327.   Say ''
  328.   Say '  * If First or Incr is omitted, then 1 is used.'
  329.   Say '  * Use Control-C to abort.'
  330.   Say '  * Example: RX LW2VLM ram:pic. MyScene 70 31 2'
  331.   Say '    The LightWave scene has 70 frames, the first frame to'
  332.   Say '    be rendered is PIC.31, and frames will be incremented'
  333.   Say '    by 2. The frames will be imported into scene named MyScene=
  334. '
  335.   Return
  336.  
  337. OpenLog:
  338.  
  339.   If ~Open('logfile', LogFN, 'A') then do
  340.     If ~Open('logfile', LogFN, 'W') then do
  341.       Say 'Error opening log file!'
  342.       Exit
  343.     End
  344.   End
  345.   Return
  346.  
  347. Break_C:
  348.  
  349.   Say 'Control-C detected...'
  350.   Say 'Line' SIGL 'RC=3D'RC
  351.   Exit
  352.  
  353.  
  354. /*
  355.  
  356. History:
  357.  
  358. 1.0.0 First version
  359.  
  360. */